package mil.af.amc.adpetracker.dao;

import mil.af.amc.adpetracker.model.*;
import mil.af.amc.adpetracker.service.ServiceException;

import java.util.List;

/**
 * Interface for EquipmentItemDao implementations
 *
 * @author TSgt Jason Ferguson
 */

public interface EquipmentItemDao extends GenericDao<EquipmentItem> {

    EquipmentItem getBySerialNumber(String serialNumber);

    EquipmentItem getBySerialAndManufacturer(String serial, Manufacturer manu);

    int getCountByAccount(AdpeAccount account);

    int getCountByUser(User user);

    List<EquipmentItem> getAllByAccount(AdpeAccount account);

    List<EquipmentItem> getAllActiveByAccount(AdpeAccount account);

    List<EquipmentItem> getAllCurrentByAccount(AdpeAccount account);
    
    List<EquipmentItem> getAllByModel(ItemModel model);

    List<EquipmentItem> getByItemType(EquipmentType itemType);

    /**
     * Retrieve all Equipment items assigned to a particular User and Adpe Account
     *
     * @param user
     * @param acct
     * @return
     */
    public List<EquipmentItem> getAllByUserAndAdpeAccount(User user, AdpeAccount acct);

    /**
     * Retrieve a List of EquipmentItems by the given attributes
     * @param acct
     * @param type
     * @param manu
     * @return
     * @throws ServiceException
     */
    List<EquipmentItem> getByAdpeAccountAndEquipmentTypeAndManufacturer(AdpeAccount acct,
                                                                               EquipmentType type,
                                                                               Manufacturer manu);

    List<EquipmentItem> getItemsByQbe(EquipmentItem item);

}
